package com.org.web.support.freemarker;

import com.org.platform.support.conponents.Web;
import freemarker.template.TemplateModelException;
import javax.annotation.PostConstruct;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

@Configuration
public class FreemarkerConfig {

  @Autowired
  private Web web;

  @Autowired
  private freemarker.template.Configuration configuration;

  @PostConstruct
  public void setSharedVariable() throws TemplateModelException {
    configuration.setSharedVariable("staticVersion", web.getStaticVersion());
  }

}
